<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2018/1/20
 * Time: 13:13
 */
namespace app\admin\model;

use think\Db;
use think\model;
class AdminLogModel extends Model
{

    public function getLogInfo($map,$field='*',$flag=true,$order='log_id desc',$page=1,$limit=10)
    {
        return $flag ? Db::name('admin_log')->where($map)->field($field)->page($page,$limit)->order($order)->select()
            : Db::name('admin_log')->where($map)->field($field)->order($order)->find();
    }

    public function addLog($data)
    {
        return Db::name('admin_log')->insertGetId($data);
    }
}